package com.channel.temperature.collect.ui.viewmodel

import android.content.Context
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.channel.temperature.collect.app.dao.TaskDataBase
import com.channel.temperature.collect.data.response.TaskBean
import kotlinx.coroutines.launch
import me.hgj.mvvmhelper.base.BaseViewModel


class EditTaskDataModel : BaseViewModel() {
    var tasklistData = MutableLiveData<ArrayList<TaskBean>>()
    fun getListData(context: Context) {
        viewModelScope.launch {
            tasklistData.value =
                TaskDataBase.get(context).taskDao().getAll() as ArrayList<TaskBean>?
        }
    }

    fun getRoomListData(context: Context) {
        viewModelScope.launch {
            tasklistData.value =
                TaskDataBase.get(context).taskDao().getAll() as ArrayList<TaskBean>?

        }
    }
}


